<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePermissionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('permissions', function (Blueprint $table) {
            $table->id();
            $table->string('name',50)->comment("权限名");
            $table->string('http_method',100)->comment("地址");
            $table->tinyInteger('order')->comment("排序");
            $table->unsignedInteger("pid")->default(0)->comment("上级id");
            $table->string('icon',100)->nullable()->comment("图标");
            $table->tinyInteger("is_menu")->default(0)->comment("是否菜单[否,是]");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('permissions');
    }
}
